<template>
  <router-view/>
</template>
<script setup>
import { onMounted,ref } from 'vue';
import { io } from 'socket.io-client'

const servicAddress = ref('ws://localhost:7070');

const socket = io(servicAddress.value, {
  transports: ['websocket'],
  upgrade: false,
  rejectUnauthorized: false,
  reconnection: true,
  reconnectionDelay: 1000,
  reconnectionDelayMax: 5000,
  reconnectionAttempts: Infinity,
  autoConnect: true,
  timeout: 5000,
  forceNew: true,
  secure: true,
})

socket.on('connect', () => {
  console.log('socket connected');
});

onMounted(() => {
  const loadingElement = document.getElementById('loadingPage');
  if (loadingElement) {
    loadingElement.remove();
  }
});

</script>
<style lang="less">
  #app {
    height: 100%;
    background: #f3f4f6;
  }
</style>
